﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ShiziEntity.User
{
    /// <summary>
    /// 经纪人用户实体类
    /// </summary>
    [Serializable]
    public class UserAgent : UserBase
    {
        public UserAgent()
        { }

        private string district;
        private string serviceComarea;
        private string compayName;
        private string mobile;
        private string telephone;
        private long? qq;
        private string msn;
        private string photoUrl;
        private string duty;
        private string graduateCollege;
        private string motto;
        private int? shopID;
        private string shopName;
        private int? checkStatus;
        private string innerNote;

        /// <summary>
        /// 区县
        /// </summary>
        public string District
        {
            set { district = value; }
            get { return district; }
        }
        /// <summary>
        /// 服务商圈
        /// </summary>
        public string ServiceComarea
        {
            set { serviceComarea = value; }
            get { return serviceComarea; }
        }
        /// <summary>
        /// 公司名称
        /// </summary>
        public string CompayName
        {
            set { compayName = value; }
            get { return compayName; }
        }
        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile
        {
            set { mobile = value; }
            get { return mobile; }
        }
        /// <summary>
        /// 电话号码
        /// </summary>
        public string Telephone
        {
            set { telephone = value; }
            get { return telephone; }
        }
        /// <summary>
        /// QQ号码
        /// </summary>
        public long? Qq
        {
            set { qq = value; }
            get { return qq; }
        }
        /// <summary>
        /// MSN
        /// </summary>
        public string Msn
        {
            set { msn = value; }
            get { return msn; }
        }
        /// <summary>
        /// 头像地址
        /// </summary>
        public string PhotoUrl
        {
            set { photoUrl = value; }
            get { return photoUrl; }
        }
        /// <summary>
        /// 职位
        /// </summary>
        public string Duty
        {
            set { duty = value; }
            get { return duty; }
        }
        /// <summary>
        /// 毕业院校
        /// </summary>
        public string GraduateCollege
        {
            set { graduateCollege = value; }
            get { return graduateCollege; }
        }
        /// <summary>
        /// 座右铭
        /// </summary>
        public string Motto
        {
            set { motto = value; }
            get { return motto; }
        }
        /// <summary>
        /// 门店编号
        /// </summary>
        public int? ShopID
        {
            set { shopID = value; }
            get { return shopID; }
        }
        /// <summary>
        /// 门店名称
        /// </summary>
        public string ShopName
        {
            set { shopName = value; }
            get { return shopName; }
        }
        /// <summary>
        /// 是否通过门店审核：0--申请,1--通过,2--未通过
        /// </summary>
        public int? CheckStatus
        {
            set { checkStatus = value; }
            get { return checkStatus; }
        }
        /// <summary>
        /// 用户公告
        /// </summary>
        public string InnerNote
        {
            set { innerNote = value; }
            get { return innerNote; }
        }

        /// <summary>
        /// 获取保存用户信息的SQL
        /// </summary>
        /// <returns>SQL语句</returns>
        public override string GetInsertSql()
        {
            //string sql = string.Empty;
            //sql = ((UserBase)this).GetInsertSql();//获取基类插入SQL
            StringBuilder sql = new StringBuilder();
            StringBuilder sqlField = new StringBuilder();
            StringBuilder sqlValue = new StringBuilder();
            if (this.UserID > -1)
            {
                sqlField.Append("UserID,");
                sqlValue.Append("" + this.UserID + ",");
            }
            if (this.UserName != null)
            {
                sqlField.Append("UserName,");
                sqlValue.Append("'" + this.UserName + "',");
            }
            if (this.CityName != null)
            {
                sqlField.Append("CityName,");
                sqlValue.Append("'" + this.CityName + "',");
            }
            if (this.District != null)
            {
                sqlField.Append("District,");
                sqlValue.Append("'" + this.District + "',");
            }
            if (this.ServiceComarea != null)
            {
                sqlField.Append("ServiceComarea,");
                sqlValue.Append("'" + this.ServiceComarea + "',");
            }
            if (this.CompayName != null)
            {
                sqlField.Append("CompayName,");
                sqlValue.Append("'" + this.CompayName + "',");
            }
            if (this.Mobile != null)
            {
                sqlField.Append("Mobile,");
                sqlValue.Append("'" + this.Mobile + "',");
            }
            if (this.Telephone != null)
            {
                sqlField.Append("Telephone,");
                sqlValue.Append("'" + this.Telephone + "',");
            }
            if (this.Qq != null)
            {
                sqlField.Append("Qq,");
                sqlValue.Append("" + this.Qq + ",");
            }
            if (this.Msn != null)
            {
                sqlField.Append("Msn,");
                sqlValue.Append("'" + this.Msn + "',");
            }
            if (this.PhotoUrl != null)
            {
                sqlField.Append("PhotoUrl,");
                sqlValue.Append("'" + this.PhotoUrl + "',");
            }
            if (this.Duty != null)
            {
                sqlField.Append("Duty,");
                sqlValue.Append("'" + this.Duty + "',");
            }
            if (this.GraduateCollege != null)
            {
                sqlField.Append("GraduateCollege,");
                sqlValue.Append("'" + this.GraduateCollege + "',");
            }
            if (this.Motto != null)
            {
                sqlField.Append("Motto,");
                sqlValue.Append("'" + this.Motto + "',");
            }
            if (this.ShopID != null)
            {
                sqlField.Append("ShopID,");
                sqlValue.Append("" + this.ShopID + ",");
            }
            if (this.ShopName != null)
            {
                sqlField.Append("ShopName,");
                sqlValue.Append("'" + this.ShopName + "',");
            }
            if (this.CheckStatus != null)
            {
                sqlField.Append("CheckStatus,");
                sqlValue.Append("" + this.CheckStatus + ",");
            }
            if (this.InnerNote != null)
            {
                sqlField.Append("InnerNote,");
                sqlValue.Append("'" + this.InnerNote + "',");
            }
            sql.Append("insert into UserAgent(");
            sql.Append(sqlField.ToString().Remove(sqlField.Length - 1));
            sql.Append(")");
            sql.Append(" values (");
            sql.Append(sqlValue.ToString().Remove(sqlValue.Length - 1));
            sql.Append(")");
            return sql.ToString();
        }
    }
}